<template>
  <div class="home-banner">
    <ShopSwiper :sliders="sliders" autoPlay></ShopSwiper>
  </div>
</template>

<script>
import { ref } from "vue";
import { getBanner } from "@/api/home";
export default {
  name: "HomeBanner",
  setup() {
    // 获取轮播图数据
    const sliders = ref([]);
    getBanner().then((data) => {
      // console.log(data)
      sliders.value = data.result;
    });
    return { sliders };
  }
};
</script>

<style scoped lang="less">
.home-banner {
  width: 990px;
  height: 500px;
  position: absolute;
  left: 250px;
  top: 0;
  z-index: 98;
}
</style>
